1. Field of the Invention
The present invention relates to an apparatus for converting a format of a data stream of, e.g., MPEG (Moving Picture Experts Group, the international standards for compression of hybrid media moving pictures) to another format. More particularly, the present invention relates to a stream converting apparatus capable of generating proper converted data even if an error is included in a received data stream.
2. Description of the Background Art
The MPEG international standard scheme is for compressing video and audio digital data. The MPEG scheme has been used for digital television broadcasting and DVD (Digital Video Discs), and is expected to become further widespread.
MPEG defines two kinds of video and audio multiplexed formats (AV (Audio and Visual) multiplexed formats): a TS (Transport Stream) format as the first format; and a PS (Program Stream) format as the second format. The PS format generates an ES (Elementary Stream) (a data train) of a first level from an arbitrary number of individually coded video, audio and other information, and further packetizes the ES to generate a PES (Packetized Elementary Stream). The PES is then multiplexed to form an integrated stream as a set of program. The header of each packet includes system clock information for reproduction. The TS format combines a plurality of such programs into a stream.
The PS format is primarily used for storage media like DVD, whereas the TS format is used for broadcasting and communication. Thus, for recording a program of the digital television broadcasting on a DVD, it is necessary to convert the stream format from TS to PS. The stream converting apparatus performs such conversion of the stream formats.
When a stream is being transmitted over a long distance in broadcasting or communication, a channel error may occur, resulting in an incomplete TS. Since a conventional stream converting apparatus presumes that the input TS is always complete, it converts the incomplete TS to a PS without alteration. This means that the PS generated is not always correct.
In the standards for DVD equipment (hereinafter, referred to as “DVD standards”) established as a PS application product, requirements for information for retrieval, information for designating a unit of processing and others have been added to those of the MPEG2 PS standards. An incorrect PS does not satisfy the DVD standards, hindering proper DVD recording.
FIG. 1 is a block diagram of a conventional stream converting apparatus. Referring to FIG. 1, the stream converting apparatus receives stream data (TS) from an input terminal 40, converts it to a PS, and outputs the PS from an output terminal 50. The apparatus includes: a TS separator 330 that receives the stream data from input terminal 40 and separates the TS into a video PES (“V-PES”), an audio PES (“A-PES”) and system clock information for output; and a PS multiplexer 332 connected to TS separator 330 that receives therefrom the V-PES, A-PES and system clock information and multiplexes them to a PS for output to output terminal 50.
The stream data input from input terminal 40 is supplied to TS separator 330, and separated to and outputted as the V-PES, A-PES and system clock information. PS multiplexer 332 multiplexes the V-PES, A-PES and system clock information into a PS, and outputs it to output terminal 50.
FIG. 2 shows another example of the conventional stream converting apparatus. Referring to FIG. 2, the stream converting apparatus receives a TS from input terminal 40, converts it to a PS and outputs the PS from output terminal 50. The apparatus includes: a TS decoder 240 that receives the stream data from input terminal 40, separates the TS into a V-ES (Elementary Stream), video (V) header parameters (PTS, DTS and others) included in a V-PES header, an A-ES, audio (A) header parameters included in an A-PES header and system clock information for output; and a PS encoder 242 connected to TS decoder 240 that receives therefrom the V-ES, V header parameters, A-ES, A header parameters and system clock information, and multiplexes them into a PS for output to output terminal 50.
Referring to FIG. 3, TS decoder 240 includes: a TS separator 350 that receives the TS from input terminal 40 and separates it into system clock information, V-PES and A-PES for output; a video PES separator 352 that separates the V-PES output from TS separator 350 into a V-ES and video header parameters for output; and an audio PES separator 354 that separates the A-PES output from TS separator 350 into an A-ES and audio header parameters for output.
Referring to FIG. 4, PS encoder 242 includes: a video PES multiplexer 360 that receives the V-ES and video header parameters from video PES separator 352 and multiplexes them into a V-PES for output; an audio PES multiplexer 362 that receives the A-ES and audio header parameters from audio PES separator 354 and multiplexes them into an A-PES for output; and a PS multiplexer 364 connected to video PES multiplexer 360, audio PES multiplexer 362 and TS separator 350 that multiplexes the V-PES output from video PES multiplexer 360 and the A-PES output from audio PES multiplexer 362 into a PS employing the system clock information provided from TS separator 350.
The stream data input from input terminal 40 is provided to TS separator 350, where it is separated into the V-ES, A-ES and system clock information and outputted therefrom. Video PES separator 352 separates the V-PES into the V-ES and video header parameters and provides them to video PES multiplexer 360. Similarly, audio PES separator 354 separates the A-PES into the A-ES and audio header parameters, and provides them to audio PES multiplexer 362.
Video PES multiplexer 360 generates the V-PES using the V-ES and video header parameters received, and provides the generated V-PES to PS multiplexer 364. Similarly, audio PES multiplexer 362 generates the A-PES using the A-ES and audio header parameter received, and provides the generated A-PES to PS multiplexer 364. PS multiplexer 364 multiplexes the V-PES supplied from video PES multiplexer 360 and the A-PES supplied from audio PES multiplexer 360 into the PS using the system clock information supplied from TS separator 350, and outputs the PS.
The TS being input may include temporary corrupted data due to a channel error. Data corruption may last for such a long period of time that the TS separator may not be able to recognize the TS packets.
In the case of the temporary corruption, the TS separator obtains a PES from the TS with the corrupted data included therein. The PES containing the corrupted data is supplied to the PS multiplexer, where it is multiplexed to a PS. The resultant PS is thus incorrect.
If the data corruption lasts for a long period of time, there occurs a period where the TS separator cannot recognize the input as the TS and thus suspends the TS separating and PES outputting processes. In such a case, the audio and video PES data thus suspended often include the clock information for reproduction different from each other. Thereafter, even if the data corruption is over, when the data at the time of suspension are multiplexed by the PS multiplexer into a PS, the resultant PS will not allow synchronization of the video and audio. Thus, reproduction of such a PS with a PS decoder (not shown) would lead to disruption in buffering, hindering proper reproduction of the video and others.
Further, the DVD standards pose the following problem. The DVD standards define approximately 15 frames as a unit of processing, and the exact number of frames in the unit of processing and the number of PS packets within the first frame should be extracted as retrieval information. If the data corruption, or the period during which the data is missing, lasts for a long period of time, the retrieval information cannot be generated correctly.